<?php
@session_start();
date_default_timezone_set("PRC");
$time = date('Y-m-d H:i:s');


include "mysql/mysql.php";
    $aa = new mysql;
    $aa->link("");
    include "myfunction.php";
    $bb= new myfunction;


$proname = isset($_POST['proname']) ? $bb->test_input($_POST['proname']) : '';
$ex01 = isset($_POST['ex01']) ? $bb->test_input($_POST['ex01']) : '';
$ex02 = isset($_POST['ex02']) ? $bb->test_input($_POST['ex02']) : '';
$shuliang = isset($_POST['shuliang']) ? $bb->test_input($_POST['shuliang']) : '';
$user_name = isset($_POST['userid']) ? $bb->test_input($_POST['userid']) : '';    //var_dump($_POST); var_dump($proname);
//shoppingmall页面传递商品id值时，id换算成name   BUT商品id一起存起来更好
$proid = isset($_POST['proid']) ? $bb->test_input($_POST['proid']) : '';
    if($proid != ''){
		$res = $bb->findprobyid($proid);
		$proname = $res['name'];
		}
//购买信息插入数据库
$bb->buyproinfo( $proname, $ex01, $ex02, $shuliang, $user_name, $time);


?>